import logging.config
import sys

def configure_logging():
    try:
        logging.config.fileConfig('resources/logging_config.ini')
        # logger = logging.getLogger(__name__)
        # logger.info("Logging configuration successful")
    except Exception as e:
        print(f"Error configuring logging: {str(e)}")
        sys.exit(1)

if __name__ == "__main__":
    configure_logging()

    # 测试日志记录器
    logger = logging.getLogger(__name__)
    logger.debug("This is a debug message")
    logging.info("This is an info message")
    logging.warning("This is a warning message")
    logging.error("This is an error message")
    logging.critical("This is a critical message")